﻿using System.Web.Optimization;

namespace XHD.WXZJ.Web
{
    public static class BundleConfig
    {
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.IgnoreList.Clear();
            #region 多模板页面使用的资源
            //VENDOR RESOURCES
            //~/Bundles/vendor/css
            bundles.Add(
                new StyleBundle("~/Bundles/vendor/css")
                    .Include(
                        "~/Content/themes/base/all.css",
                        "~/Content/bootstrap-cosmo.min.css",
                        "~/Content/toastr.min.css",
                        "~/Scripts/sweetalert/sweet-alert.css",
                        "~/Content/flags/famfamfam-flags.css",
                        "~/Content/font-awesome.min.css"
                    )
                );

            //~/Bundles/vendor/js/top (These scripts should be included in the head of the page)
            bundles.Add(
                new ScriptBundle("~/Bundles/vendor/js/top")
                    .Include(
                        "~/Abp/Framework/scripts/utils/ie10fix.js",
                        "~/Scripts/modernizr-2.8.3.js"
                    )
                );

            //~/Bundles/vendor/bottom (Included in the bottom for fast page load)
            bundles.Add(
                new ScriptBundle("~/Bundles/vendor/js/bottom")
                    .Include(
                        "~/Scripts/json2.min.js",

                        "~/Scripts/jquery-2.1.4.min.js",
                        "~/Scripts/jquery-ui-1.11.4.min.js",

                        "~/Scripts/bootstrap.min.js",

                        "~/Scripts/moment-with-locales.min.js",
                        "~/Scripts/jquery.validate.min.js",
                        "~/Scripts/jquery.blockUI.js",
                        "~/Scripts/toastr.min.js",
                        "~/Scripts/sweetalert/sweet-alert.min.js",
                        "~/Scripts/others/spinjs/spin.js",
                        "~/Scripts/others/spinjs/jquery.spin.js",

                        "~/Abp/Framework/scripts/abp.js",
                        "~/Abp/Framework/scripts/libs/abp.jquery.js",
                        "~/Abp/Framework/scripts/libs/abp.toastr.js",
                        "~/Abp/Framework/scripts/libs/abp.blockUI.js",
                        "~/Abp/Framework/scripts/libs/abp.spin.js"
                    )
                );
            //~/Bundles/css
            bundles.Add(
                new StyleBundle("~/Bundles/css")
                    .Include("~/css/main.css")
                );

            //~/Bundles/js
            bundles.Add(
                new ScriptBundle("~/Bundles/js")
                    .Include("~/js/main.js")
                );
            #endregion

            #region spa使用的资源
            //~/Bundles/App/vendor/css
            bundles.Add(
                new StyleBundle("~/Bundles/App/vendor/css")
                    .Include(
                        "~/Content/themes/base/all.css",
                        "~/Content/bootstrap-cosmo.min.css",
                        "~/Content/toastr.min.css",
                        "~/Scripts/sweetalert/sweet-alert.css",
                        "~/Content/flags/famfamfam-flags.css",
                        "~/Content/font-awesome.min.css"
                    )
                );

            //~/Bundles/App/vendor/js
            bundles.Add(
                new ScriptBundle("~/Bundles/App/vendor/js")
                    .Include(
                        "~/Abp/Framework/scripts/utils/ie10fix.js",
                        "~/Scripts/json2.min.js",

                        "~/Scripts/modernizr-2.8.3.js",

                        "~/Scripts/jquery-2.1.4.min.js",
                        "~/Scripts/jquery-ui-1.11.4.min.js",

                        "~/Scripts/bootstrap.min.js",

                        "~/Scripts/moment-with-locales.min.js",
                        "~/Scripts/jquery.blockUI.js",
                        "~/Scripts/toastr.min.js",
                        "~/Scripts/sweetalert/sweet-alert.min.js",
                        "~/Scripts/others/spinjs/spin.js",
                        "~/Scripts/others/spinjs/jquery.spin.js",

                        "~/Scripts/angular.min.js",
                        "~/Scripts/angular-animate.min.js",
                        "~/Scripts/angular-sanitize.min.js",
                        "~/Scripts/angular-ui-router.min.js",
                        "~/Scripts/angular-ui/ui-bootstrap.min.js",
                        "~/Scripts/angular-ui/ui-bootstrap-tpls.min.js",
                        "~/Scripts/angular-ui/ui-utils.min.js",

                        "~/Abp/Framework/scripts/abp.js",
                        "~/Abp/Framework/scripts/libs/abp.jquery.js",
                        "~/Abp/Framework/scripts/libs/abp.toastr.js",
                        "~/Abp/Framework/scripts/libs/abp.blockUI.js",
                        "~/Abp/Framework/scripts/libs/abp.spin.js",
                        "~/Abp/Framework/scripts/libs/abp.sweet-alert.js",
                        "~/Abp/Framework/scripts/libs/angularjs/abp.ng.js"
                    )
                );
            //~/Bundles/Abp/js
            bundles.Add(
                new ScriptBundle("~/Bundles/Abp/js")
                    .Include(
                        "~/Abp/Framework/scripts/utils/ie10fix.js",
                        "~/Scripts/json2.min.js",

                        "~/Scripts/modernizr-2.8.3.js",

                        "~/Scripts/jquery-2.1.4.min.js",
                        "~/Scripts/jquery-ui-1.11.4.min.js",
                        "~/Scripts/bootstrap.min.js",

                        "~/Scripts/moment-with-locales.min.js",
                        "~/Scripts/jquery.blockUI.js",
                        "~/Scripts/toastr.min.js",
                        "~/Scripts/sweetalert/sweet-alert.min.js",
                        "~/Scripts/others/spinjs/spin.js",
                        "~/Scripts/others/spinjs/jquery.spin.js",

                        "~/Abp/Framework/scripts/abp.js",
                        "~/Abp/Framework/scripts/libs/abp.jquery.js",
                        "~/Abp/Framework/scripts/libs/abp.toastr.js",
                        "~/Abp/Framework/scripts/libs/abp.blockUI.js",
                        "~/Abp/Framework/scripts/libs/abp.spin.js",
                        "~/Abp/Framework/scripts/libs/abp.sweet-alert.js"
                    )
                );
            //~/Bundles/App/Main/css
            bundles.Add(
                new StyleBundle("~/Bundles/App/Main/css")
                    .IncludeDirectory("~/App/Main", "*.css", true)
                );

            //~/Bundles/App/Main/js
            bundles.Add(
                new ScriptBundle("~/Bundles/App/Main/js")
                    .IncludeDirectory("~/App/Main", "*.js", true)
                );
            #endregion
            #region webxin使用的资源
            //添加webix js引用
            bundles.Add(
                new ScriptBundle("~/Bundles/App/Webix/js")
                .Include(
                "~/Scripts/webix/codebase/webix.js",
                 "~/Scripts/webix/codebase/webix_debug.js"

                ));
            //APPLICATION RESOURCES
            //添加webix css引用
            bundles.Add(
               new StyleBundle("~/Bundles/App/Webix/css")
                   .IncludeDirectory("~/Scripts/webix/codebase", "*.css", true)
               );
            #endregion

            #region EasyUI资源
            //~/easyui/css
            bundles.Add(
                new StyleBundle("~/easyui/css/default")
                    .Include("~/Content/themes/default/easyui.css",
                     "~/Content/themes/color.css",
                     "~/Content/themes/icon.css"
                     )
                     .IncludeDirectory("~/Content/themes/default","*.css")
                );
            //metro
            bundles.Add(
               new StyleBundle("~/easyui/css/metro")
               .Include("~/Content/themes/default/easyui.css",
                "~/Content/themes/color.css",
                "~/Content/themes/icon.css"
               )
                  .IncludeDirectory("~/Content/themes/metro","*.css")
               );
            //bootstrap
            bundles.Add(
              new StyleBundle("~/easyui/css/bootstrap")
              .Include("~/Content/themes/default/easyui.css",
               "~/Content/themes/color.css",
               "~/Content/themes/icon.css"
              )
                 .IncludeDirectory("~/Content/themes/bootstrap", "*.css")
              );

            //black
            bundles.Add(
              new StyleBundle("~/easyui/css/black")
              .Include("~/Content/themes/default/easyui.css",
               "~/Content/themes/color.css",
               "~/Content/themes/icon.css"
              )
                 .IncludeDirectory("~/Content/themes/black", "*.css")
              );

            //gray
            bundles.Add(
              new StyleBundle("~/easyui/css/gray")
              .Include("~/Content/themes/default/easyui.css",
               "~/Content/themes/color.css",
               "~/Content/themes/icon.css"
              )
                 .IncludeDirectory("~/Content/themes/gray", "*.css")
              );
            //~/easyui/js
            bundles.Add(
                new ScriptBundle("~/easyui/js")
                    .Include("~/Scripts/jquery.easyui-1.4.3.min.js",
                    "~/Scripts/easyui/easyui-lang-zh_CN.js"
                    )
                );
            #endregion
        }
    }
}